      IMPLICIT REAL*8 (A-H, L-Z)
      real m1,m2,tb0,mx,mx2,tbx,eccx,rate
      integer I
      open(10,file='num.dat',status='unknown')
      open(96,file='porb-4.out',status='unknown')   
      open(97,file='porb-3.out',status='unknown')   
      open(98,file='porb-2.out',status='unknown')   
      open(99,file='porb-1.out',status='unknown')   
      open(100,file='porb0.out',status='unknown')      
      open(101,file='porb1.out',status='unknown')
      open(102,file='porb2.out',status='unknown')
      open(103,file='porb3.out',status='unknown')
      open(104,file='porb4.out',status='unknown')
      open(105,file='porb5.out',status='unknown')
      open(106,file='porb6.out',status='unknown')
      open(107,file='porb7.out',status='unknown')
      open(108,file='porb8.out',status='unknown')
      open(109,file='porb9.out',status='unknown')
      open(110,file='porb10.out',status='unknown')
      open(111,file='porb11.out',status='unknown')
      open(112,file='porb12.out',status='unknown')
      open(113,file='porb13.out',status='unknown')
      open(114,file='porb14.out',status='unknown')
      open(115,file='porb15.out',status='unknown')
      open(116,file='porb16.out',status='unknown')
      open(117,file='porb17.out',status='unknown')
      open(118,file='porb18.out',status='unknown')
      open(119,file='porb19.out',status='unknown')
      open(120,file='porb20.out',status='unknown')
      open(121,file='porb21.out',status='unknown')
      open(122,file='porb22.out',status='unknown')
      open(123,file='porb23.out',status='unknown')
      open(124,file='porb24.out',status='unknown')
      open(125,file='porb25.out',status='unknown')
      open(126,file='porb26.out',status='unknown')
      open(127,file='porb27.out',status='unknown')
      open(128,file='porb28.out',status='unknown')
      open(129,file='porb29.out',status='unknown')
      open(130,file='porb30.out',status='unknown')
      
      open(153,file='M3.out',status='unknown')
      open(154,file='M4.out',status='unknown')
      open(155,file='M5.out',status='unknown')
      open(156,file='M6.out',status='unknown')
      open(157,file='M7.out',status='unknown')
      open(158,file='M8.out',status='unknown')
      open(159,file='M9.out',status='unknown')
      open(160,file='M10.out',status='unknown')
      open(161,file='M11.out',status='unknown')
      open(162,file='M12.out',status='unknown')
      open(163,file='M13.out',status='unknown')
      open(164,file='M14.out',status='unknown')
      open(165,file='M15.out',status='unknown')
      open(166,file='M16.out',status='unknown')
      open(167,file='M17.out',status='unknown')
      open(168,file='M18.out',status='unknown')
      open(169,file='M19.out',status='unknown')
      open(170,file='M20.out',status='unknown')                       
      do  I = 1, 100000      
      read(10,*)rate,tbx,eccx,mx,mx2      
      if(mx.le.6.0.and.eccx.gt.0.and.tbx.gt.0.2.and.mx.gt.0.6)then
      tbx = log10(tbx)
      if(tbx.le.-0.4)then     
      write(96,*) rate,tbx       
      elseif(tbx.le.-0.3)then
      write(97,*) rate,tbx       
      elseif(tbx.le.-0.2)then
      write(98,*) rate,tbx       
      elseif(tbx.le.-0.1)then
      write(99,*) rate,tbx       
      elseif(tbx.le.0)then
      write(100,*) rate,tbx       
      elseif(tbx.le.0.1)then
      write(101,*) rate,tbx
      elseif(tbx.le.0.2)then
      write(102,*) rate,tbx
      elseif(tbx.le.0.30)then
      write(103,*) rate,tbx
      elseif(tbx.le.0.40)then
      write(104,*) rate,tbx
      elseif(tbx.le.0.50)then
      write(105,*) rate,tbx
      elseif(tbx.le.0.60)then
      write(106,*) rate,tbx
      elseif(tbx.le.0.70)then
      write(107,*) rate,tbx,mx2
      elseif(tbx.le.0.80)then
      write(108,*) rate,tbx
      elseif(tbx.le.0.90)then
      write(109,*) rate,tbx
      elseif(tbx.le.1.00)then
      write(110,*) rate,tbx
      elseif(tbx.le.1.10)then
      write(111,*) rate,tbx
      elseif(tbx.le.1.20)then
      write(112,*) rate,tbx
      elseif(tbx.le.1.30)then
      write(113,*) rate,tbx
      elseif(tbx.le.1.40)then
      write(114,*) rate,tbx
      elseif(tbx.le.1.50)then
      write(115,*) rate,tbx
      elseif(tbx.le.1.60)then
      write(116,*) rate,tbx
      elseif(tbx.le.1.70)then
      write(117,*) rate,tbx
      elseif(tbx.le.1.80)then
      write(118,*) rate,tbx
      elseif(tbx.le.1.90)then
      write(119,*) rate,tbx
      elseif(tbx.le.2.00)then
      write(120,*) rate,tbx
      elseif(tbx.le.2.10)then
      write(121,*) rate,tbx
      elseif(tbx.le.2.20)then
      write(122,*) rate,tbx
      elseif(tbx.le.2.30)then
      write(123,*) rate,tbx
      elseif(tbx.le.2.40)then
      write(124,*) rate,tbx
      elseif(tbx.le.2.50)then
      write(125,*) rate,tbx
      elseif(tbx.le.2.60)then
      write(126,*) rate,tbx
      elseif(tbx.le.2.70)then
      write(127,*) rate,tbx
      elseif(tbx.le.2.80)then
      write(128,*) rate,tbx
      elseif(tbx.le.2.90)then
      write(129,*) rate,tbx
      elseif(tbx.le.3.00)then
      write(130,*) rate,tbx
      endif
     
      
      if(mx.le.0.9)then
      write(153,*) rate,mx
      elseif(mx.le.1.2)then      
      write(154,*) rate,mx
      elseif(mx.le.1.5)then
      write(155,*) rate,mx
      elseif(mx.le.1.8)then
      write(156,*) rate,mx
      elseif(mx.le.2.1)then
      write(157,*) rate,mx
      elseif(mx.le.2.4)then
      write(158,*) rate,mx
      elseif(mx.le.2.7)then
      write(159,*) rate,mx
      elseif(mx.le.3.0)then
      write(160,*) rate,mx
      elseif(mx.le.3.3)then
      write(161,*) rate,mx
      elseif(mx.le.3.6)then
      write(162,*) rate,mx
      elseif(mx.le.3.9)then
      write(163,*) rate,mx
      elseif(mx.le.4.2)then
      write(164,*) rate,mx
      elseif(mx.le.4.5)then
      write(165,*) rate,mx
      elseif(mx.le.4.8)then
      write(166,*) rate,mx
      elseif(mx.le.5.1)then
      write(167,*) rate,mx
      elseif(mx.le.5.4)then
      write(168,*) rate,mx
      elseif(mx.le.5.7)then
      write(169,*) rate,mx
      elseif(mx.le.6.0)then
      write(170,*) rate,mx     
      endif      
      endif
      enddo
      end
